package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.StoreMapper;
import com.gxa.saas.pojo.Store;
import com.gxa.saas.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service
@Transactional(rollbackFor = Throwable.class)
public class StoreServiceImpl implements StoreService {

    @Autowired
    StoreMapper storeMapper;

    @Override
    public List<Store> selectByPage(Integer page, Integer size) {
     return    storeMapper.selectByPage(size*(page-1),size);
    }

    @Override
    public List<Store> selectAll() {
        return storeMapper.selectAll();
    }

    @Override
    public List<Store> selectByName(Map map) {
        return storeMapper.selectByName(map);
    }
}
